package org.lanyu.springainovel.common.dto;

/**
 * 统一任务消息DTO
 * 用于WebSocket通信的统一消息格式
 */
public class UnifiedTaskMessage {
    
    /**
     * 功能模块类型：outline, chapter, analysis等
     */
    private String type;
    
    /**
     * 任务唯一标识：bookid_outline, bookid_chapter_num等
     */
    private String taskId;
    
    /**
     * 任务状态：PENDING, PROCESSING, COMPLETED, FAILED
     */
    private String status;
    
    /**
     * 进度百分比：0-100
     */
    private Integer progress;
    
    /**
     * 状态描述或进度信息
     */
    private String message;
    
    /**
     * 时间戳
     */
    private Long timestamp;
    
    public UnifiedTaskMessage() {
        this.timestamp = System.currentTimeMillis();
    }
    
    public UnifiedTaskMessage(String type, String taskId, String status, Integer progress, String message) {
        this();
        this.type = type;
        this.taskId = taskId;
        this.status = status;
        this.progress = progress;
        this.message = message;
    }
    
    public String getType() {
        return type;
    }
    
    public void setType(String type) {
        this.type = type;
    }
    
    public String getTaskId() {
        return taskId;
    }
    
    public void setTaskId(String taskId) {
        this.taskId = taskId;
    }
    
    public String getStatus() {
        return status;
    }
    
    public void setStatus(String status) {
        this.status = status;
    }
    
    public Integer getProgress() {
        return progress;
    }
    
    public void setProgress(Integer progress) {
        this.progress = progress;
    }
    
    public String getMessage() {
        return message;
    }
    
    public void setMessage(String message) {
        this.message = message;
    }
    
    public Long getTimestamp() {
        return timestamp;
    }
    
    public void setTimestamp(Long timestamp) {
        this.timestamp = timestamp;
    }
    
    @Override
    public String toString() {
        return "UnifiedTaskMessage{" +
                "type='" + type + '\'' +
                ", taskId='" + taskId + '\'' +
                ", status='" + status + '\'' +
                ", progress=" + progress +
                ", message='" + message + '\'' +
                ", timestamp=" + timestamp +
                '}';
    }
}